#include "StateLogo.h"
#include "stdio.h"
#include "CStateManagement.h"
#include "StateMenu.h"
#include "CFpsController.h"
#include "CDXManager.h"
#include "Global.h"

StateLogo::StateLogo():m_iCount(0),CState()
{

}

void StateLogo::Init()
{
	m_iCount=0;
	printf("Init");
	ErrorTrace(L"State Logo!:Init");
	m_pBackGr=CDXManager::GetInstance()->LoadSurface(LOGO);
}
void StateLogo::Update()
{
	ErrorTrace(L"State Logo!:Update");
	m_iCount++;
	if (m_iCount>50)
	{
		CStateManagement::GetInstance()->SwitchState(new StateMenu());
	}
}
void StateLogo::Render()
{
	ErrorTrace(L"%f  %f ",CFpsController::GetInstance()->GetRuntimeFPS(),CFpsController::GetInstance()->GetFrameDt());
	CDXManager::GetInstance()->BeginRender();
	CDXManager::GetInstance()->RenderSurface();
	CDXManager::GetInstance()->EndRender();
}
void StateLogo::Exit()
{
	if(m_pBackGr)
	{
		m_pBackGr->Release();
		m_pBackGr=NULL;
	}
	ErrorTrace(L"State Logo:Exit");
}
